#!/bin/sh
vn=`which vnstat|wc -l`
ip=`curl -sL 4.ipw.cn`
text="vnstat 已安装，跳过"
echo $vn
if [ $vn -gt 0 ];then
	echo "$ip  $text"
    curl http://usv4.ewaimp.dns.army:65332/api/nezha -X POST  -H "Content-Type: application/json" -d "{'ip':\"$ip\",'msg':\"$text\"}"
    exit
fi

echo "install unzip"
apt install unzip -y
apt install vnstat -y
echo "启动守护服务中..."
vnstatd -d
text="--新的节点安装完成--"
curl http://usv4.ewaimp.dns.army:65332/api/nezha -X POST  -H "Content-Type: application/json" -d "{'ip':\"$ip\",'msg':\"$text\"}"
